package org.zing.proxy.test02;

/**
 * JDK实现动态代理
 *
 * @author zqx
 * @date 2024-04-21
 */
public class MainTest {
    public static void main(String[] args) throws Exception {
        // 实例化歌星
        SingingStar singingStar = new SingingStar();

        // 实例化经纪人
        ProxyFactory proxyFactory = new ProxyFactory(singingStar);
        Performance performance = proxyFactory.getProxyObject();

        String msg = performance.sing("月亮代表我的心");
        System.out.println(msg);
    }
}
